#region Summary

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : JackieHan.NHibernate3.Repository
// 
// File : ConfORMInitializeNHConfiguration.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 用ConfORM框架自动生成Mapping
// 
// History : 
//			2010-09-15 00:52:26	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using JackieHan.NHibernate3.Domain;
using NHibernate;
using NHibernate.Cfg;

#endregion

namespace JackieHan.NHibernate3.Repository
{
    /// <summary> 
    /// 用ConfORM框架自动生成Mapping
    /// </summary>
    public class ConfORMInitializeNHConfiguration:IInitializeNHConfiguration
    {

        #region IInitializeNHConfiguration Members

        public ISessionFactory Initialize()
        {
            Configuration cfg = LambdaConfiguration.CompletedConfig();
            cfg.AddDeserializedMapping(NHSessionFactory.GetMapping<UserInfo>(), "UserInfo");
            return cfg.BuildSessionFactory();
        }

        #endregion
    }
}